<?php
// fonctions utiles

function format_html($str) {
	return str_replace("\n", "<br/>", $str);
}

function sprintd($number) {
	if (round($number, 0) == $number) {
		return sprintf('%d', $number);
	} elseif (round($number, 1) == $number) {
		return sprintf('%.1f', $number);
	} else {
		return sprintf('%.2f', $number);
	}
}

?>
